package com.yyfax.pay.console.dao;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.yyfax.pay.console.domain.ExceptionRecordDO;
import org.apache.ibatis.annotations.Param;

import com.yyfax.pay.vo.consloe.ExceptionRecord;

public interface ExceptionRecordDao {

	/**
	 * 保存异常记录
	 *
	 * @author wangjwy
	 * @date 2018/7/4 14:34
	 * @since 2.2.3
	 * @param record
	 * @return int
	 */
	int insert(ExceptionRecordDO record);

	/**
	 * 根据条件查询异常记录
	 *
	 * @author wangjwy
	 * @date 2018/7/4 14:37
	 * @since 2.2.3
	 * @param busiId, beginTime, endTime, exceptionRecordState, start, pageSize
	 * @return java.util.List<com.yyfax.pay.console.domain.ExceptionRecordDO>
	 */
	List<ExceptionRecordDO> listExceptionRecords(@Param("busiId") String busiId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime,
			@Param("exceptionRecordState") Integer exceptionRecordState, @Param("start") Integer start, @Param("pageSize") Integer pageSize);

	/**
	 * 查询分页总记录数
	 *
	 * @author wangjwy
	 * @date 2018/7/4 14:38
	 * @since 2.2.3
	 * @param [busiId, beginTime, endTime, state]
	 * @return int
	 */
	int selectCountEffective(@Param("busiId") String busiId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime,
			@Param("exceptionRecordState") Integer state);

	/**
	 * 根据id查询总数量
	 *
	 * @author wangjwy
	 * @date 2018/7/4 14:38
	 * @since 2.2.3
	 * @param [expRecordIds, successState, state]
	 * @return java.util.List<com.yyfax.pay.console.domain.ExceptionRecordDO>
	 */
	List<ExceptionRecordDO> queryListByIds(@Param("expRecordIds") List<Integer> expRecordIds, @Param("successState") Integer successState,
			@Param("dealingState") Integer state);

	/**
	 * 更新状态
	 *
	 * @author wangjwy
	 * @date 2018/7/4 14:39
	 * @since 2.2.3
	 * @param id, state, originStates, resultDesc, opreationMOde
	 * @return int
	 */
	int updateState(@Param("id") Integer id, @Param("state") Integer state, @Param("originStates") ArrayList<Integer> originStates,
			@Param("resultDesc") String resultDesc, @Param("optMode") Integer opreationMOde);

	/**
	 * 更新订单状态
	 *
	 * @author wangjwy
	 * @date 2018/7/4 14:39
	 * @since 2.2.3
	 * @param [expRecordId, value, resultDesc, opreationMOde]
	 * @return int
	 */
	int modifyState(@Param("id") Integer expRecordId, @Param("state") int value, @Param("resultDesc") String resultDesc,
			@Param("optMode") Integer opreationMOde);
}